﻿using MyHome.Server.PluginBase;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace MyHome.Server.Net
{
    [ServiceContract]
    public interface IService
    {
        #region Plugins

        [OperationContract]
        PluginTemplate AddPlugin(PluginTemplate template);

        [OperationContract]
        IEnumerable<PluginTemplate> GetPlugins();

        [OperationContract]
        void DeletePlugin(int pluginId);

        [OperationContract]
        IEnumerable<PluginTemplate> UpdatePlugins(IEnumerable<PluginTemplate> plugins);

        #endregion Plugins

        #region PluginConnections

        [OperationContract]
        PluginConnectionTemplate AddPluginConnections(PluginConnectionTemplate template);

        [OperationContract]
        IEnumerable<PluginConnectionTemplate> GetPluginConnections();

        [OperationContract]
        void DeletePluginConnection(int pluginConnectionId);

        [OperationContract]
        IEnumerable<PluginConnectionTemplate> UpdatePluginConnections(IEnumerable<PluginConnectionTemplate> pluginConnections);

        #endregion PluginConnections

        #region PluginTypes

        [OperationContract]
        IEnumerable<string> GetPluginTypes();

        #endregion PluginTypes

        #region PluginHostOperations

        [OperationContract]
        void StartPlugins();

        [OperationContract]
        void StartPlugin(int pluginId);


        [OperationContract]
        void StopPlugin(int pluginId);

        [OperationContract]
        void StopPlugins();

        [OperationContract]
        void LoadPlugins();

        #endregion PluginHostOperations
        
    }
}